package com.okbihuo.perm.core.logger.service;

import cn.hutool.core.bean.BeanUtil;
import com.okbihuo.perm.core.logger.domain.LogRecord;
import com.okbihuo.perm.core.logger.domain.PermLog;
import com.okbihuo.perm.core.logger.mapper.PermLogMapper;
import com.okbihuo.perm.core.mp.base.MyServiceImpl;
import org.springframework.stereotype.Service;

/**
 * LogServiceImpl
 */
@Service
public class LogServiceImpl extends MyServiceImpl<PermLogMapper, PermLog> implements ILogService,ILogHandler {

    @Override
    public boolean saveLog(LogRecord logRecord) {
        PermLog permLog = new PermLog();
        BeanUtil.copyProperties(logRecord, permLog);
        return saveOrUpdate(permLog);
    }
}
